<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    
    <title>售后</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    	
	<meta http-equiv="description" content="This is my page">
	
	<link href="<%=basePath %>/background/css/layout.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/background/css/header.css" rel="stylesheet" type="text/css" />
		
  </head>
  
  <body>
  
  <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	<tr valign="top">
  	
  		<td height="100">
  			 <jsp:include page="/background/head.jsp"></jsp:include>
  		</td>
  	</tr>
  	<tr valign="top">
  		<td>
  		
   
   
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">

    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
					<s:include value="/background/left.jsp"></s:include>		
     	</td>
     	
     	
     	<td valign="top" >
     	
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>查找售后信息
     			
     			<input type="button" value="查看谁有权限" 
     				onclick="javascript:openUrlForDialog('selectoperatorlimitedAction_background.action?limitedCode=<s:property value="limitedcode"/>')"/>
     			</td>
     			<td align="right"> <a href="preaddaftersaleservice_warehouse.action">添加售后</a> </td>
     		</tr>
     	</table>
     	
     	<table align="center" width="100%">
     		<tr>
     			<td><s:fielderror id="errormessage" /></td>
     		</tr>
     	</table>
     	
    <form id="managereceiptlist_warehouse" name="managereceiptlist_warehouse" onSubmit="return true;" action="manageaftersaleservice_warehouse.action" method="POST" >
    	
			<table  border="0"  width="100%">
				<tr>
				  <td>
					  查找售后信息:<input type="text" name="searchStr" size="30" value="<s:property value="searchStr"/>" autofocus="autofocus"/>
					  <input type="submit" value="查找" />
				  </td>
			  </tr>
			</table>
	</form> 
	
	
		<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>售后列表
     			<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.START">收到售后:<s:property value="flowAftersaleservice"/></a>
     			
     			<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.RECEIVE">收到货:<s:property value="flowReceive"/></a> 
     			
     				<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.MISSING">漏发补发:<s:property value="flowMiss"/></a>     				
     				
     				
     				
     				<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.CONFIRMQUESTION">验证问题:<s:property value="flowConfirmquerstion"/></a>
     				
     				<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.CONFIRMSHIP">回发现付:<s:property value="flowConfirmship"/></a>
     				
     				<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.CONFIRMSHIPNOTPAY">回发到付:<s:property value="flowConfirmshipnotpay"/></a>
     				
     				<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.TRUNBACK">退货:<s:property value="flowTrunback"/></a>
     				<a href="manageaftersaleservice_warehouse.action?flowCode=FLOW.WAREHOUSE.AFTERSALESERVICE.CANCEL">取消流程:<s:property value="flowCancel"/></a>
     			</td>
     		</tr>
     	</table>
		
		
		
		<table  width="100%">
			
		
			<s:iterator id="aftersaleserviceList" value="aftersaleserviceList">
				<tr>

					<td>
					
						<table border="0" cellpadding="0"  cellspacing="0" width="100%"  style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff">
									<tr>
										<td>
											<table bgcolor="#f3f7fc"  width="100%">
												<tr>
													<td>
														售后:<a href="infoaftersaleservice_warehouse.action?id=<s:property value="#aftersaleserviceList.id_aftersaleservice"/>"><s:property value="#aftersaleserviceList.id_aftersaleservice"/></a>
													    	出仓:
															<s:if test="#aftersaleserviceList.receiptlistid_aftersaleservice == 0">
					
																无出仓号
															</s:if>
															<s:else>
																<a href="receiptlistinfo_warehouse.action?id=<s:property value="#aftersaleserviceList.receiptlistid_aftersaleservice"/>">
																	<s:property value="#aftersaleserviceList.receiptlistid_aftersaleservice"/>
																</a>
															</s:else>
													
													<td>
													
													</td>
													<td align="right" >
														时间:<s:property value="#aftersaleserviceList.date_aftersaleservice"/>
													</td>
													
												 	
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table  width="100%" border="1" cellpadding="0"  cellspacing="0" bordercolor="#f5f5f5" style="border-collapse:collapse; border-width:1px 0 0 1px;">
												<tr>
													<td width="435"  width="100%">
													
													
													
													
														<table  width="100%">
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																产品信息:<s:property value="#aftersaleserviceList.goodsinfo_aftersaleservice"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
															
															
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																问题描述:<s:property value="#aftersaleserviceList.problemdescription_aftersaleservice"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
															
															
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																验证问题:<s:property value="#aftersaleserviceList.confirmproblemdescription_aftersaleservice"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
														</table>
													
													
														
													</td>
													
													<td align="center" width="185">
														<font color="green">
														<s:property value="#aftersaleserviceList.receiveshipno_aftersaleservice"/>
														</font>
														</br>
														<s:if test="#aftersaleserviceList.shipno_aftersaleservice != null "> 
														<font color="red">
														<s:property value="#aftersaleserviceList.shipno_aftersaleservice"/>
														</font>
														</s:if>
													</td>
													
													<td align="center" title="<s:property value="#aftersaleserviceList.customerinfo_aftersaleservice"/>">
														<s:property value="#aftersaleserviceList.customerid_aftersaleservice"/>
													</td>
													
													<td align="center">
														
														<s:property value="flowRecordlistMap.get(#aftersaleserviceList.id_aftersaleservice).cnname_recordlist"/>
														<br/>
														<button onclick="javascript:openUrlForDialog('<%=basePath %>flow/enterflow.action?kind=FLOW.WAREHOUSE.AFTERSALESERVICE&kindid=<s:property value="#aftersaleserviceList.id_aftersaleservice"/>')">
															查看流程
														</button>
													</td>
													
													<td align="center">
													
															
														<s:property value="#aftersaleserviceList.username_aftersaleservice"/>
														
														</br>
														<s:if test="#session.userInfo.user_email == #receiptlistList.useremail_receiptlist">
															<a href="javascript:del('<s:property value="#receiptlistList.customerid_receiptlist"/>',<s:property value="#receiptlistList.id_receiptlist"/>)"> 取消此订单 </a>
														</s:if>
													
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<s:if test="#aftersaleserviceList.remark_aftersaleservice!=''">
									<tr>
										<td bgcolor="fff7d9">
											备注：<s:property value="#aftersaleserviceList.remark_aftersaleservice"/>
										</td> 
									</tr>
									</s:if>
									
									
							</table>
					
					
					
						
					</td>

				</tr>
			</s:iterator>
		</table>
	
	<table width="100%" border="0" cellpadding="0" bgcolor="" cellspacing="0" >
				<tr >
					<td >
						<%
						String url = "manageaftersaleservice_warehouse.action";//*/
						int pageSize = (Integer) request.getAttribute("pageSize");
						int beginPageNum =  (Integer) request.getAttribute("beginPageNum");
						int countRow =  (Integer) request.getAttribute("rowNum");
					    int countPage =(countRow-1)/pageSize+1;
					    int currentPage = countPage - (countRow-beginPageNum)/pageSize;
					    
					    String flowCode = (String)request.getAttribute("flowCode");//*/
					    
					 	 
					    
					    String searchstr = (String)request.getParameter("searchStr");//*/
					    if(searchstr != null){
					    	searchstr = java.net.URLDecoder.decode(searchstr, "UTF-8");
					    	searchstr = java.net.URLEncoder.encode(searchstr,"UTF-8");
					    	searchstr = searchstr.replaceAll("%", "%25");
					    }else{
					    	searchstr = "";
					    }
					    
					    if((beginPageNum-pageSize+1) >= 1){%>
				    	<a href="<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=(beginPageNum-pageSize) %>&flowCode=<%=flowCode %>">
								上一页 </a>
				   <% }
					    
					    //beginPageNum =  (pageNum - 1) * pageSize;
						StringBuffer chagePageBuff = new StringBuffer();
						if(countPage >= 2){ 
							int begin = currentPage - 9;
							int end = currentPage + 9;
							
							if(begin < 1){
								begin = 0;
							}
							if(end > countPage){
								end = countPage-1;
							}
							
							
							for(int i=begin;i<countPage;i++){
								
								
								
								
								
								if(beginPageNum == i*pageSize){
									%>
									<%=i+1 %>
									<%
								}else{
									%>
									<a href="<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=i*pageSize %>&flowCode=<%=flowCode %>">
									[<%=i+1 %>] </a>
									<%
								}
								
								if(i > end){
									
									break;
									
								}
							}
						}
						
						if((beginPageNum+pageSize-countRow) < 0){%>
				    	<a href="<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=(beginPageNum+pageSize) %>&flowCode=<%=flowCode %>">
								下一页 </a>
				   		<% }
						if(countPage != 1){%>
			    		<input type="text" size="4" id="goPageNum" name="goPageNum"/> / <%=countPage %> <button onclick="gotoPage();">跳转</button>
				   		<% }
						//*/
						%>
					</td>

				</tr>
				
			</table>
			
	</td>
	
	
	
</tr>

</table>

</td>
</tr>
<tr valign="bottom">
	<td>
		<jsp:include page="/background/tail.jsp"></jsp:include>
	</td>
</tr>
</table>



  </body>
<script type="text/javascript">



function gotoPage(){
	countPage = <%=countPage %>;
	pageSize = <%=pageSize %>;
	pageNum = document.getElementById("goPageNum").value;

	pageNum = parseInt(pageNum);
	if(pageNum > countPage){
		pageNum = countPage;
	}
	beginPageNum = pageNum * pageSize - pageSize;
	if(beginPageNum < 0){
		beginPageNum = 0;

	}
	if(isNaN(beginPageNum)){
		beginPageNum = 0;
	}
	url = '<%=url %>?searchStr=<%=searchstr %>&beginPageNum=' + beginPageNum + '&flowCode=<%=flowCode %>';
	//alert(url);
	window.location.href=url;
}
</script>
</html>
